﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="QuanlySinhvien_Admin.aspx.cs" Inherits="QuanlySinhvien_Admin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MenuPlaceHolder" Runat="Server">
    <div>
    <asp:Menu ID="Menu1" runat="server" CssClass="MainMenu" Orientation="Horizontal">
        <Items>
            <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Trang chủ" Value="HomePage"></asp:MenuItem>
            <asp:MenuItem NavigateUrl="~/Login.aspx" Text ="Thoát" Value="SignOut"></asp:MenuItem>
        </Items>
    </asp:Menu>
        <asp:Menu ID="Menu3" runat="server" CssClass="MainMenuright" Orientation="Horizontal">
        <Items>
            <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Trang chủ" Value="HomePage"></asp:MenuItem>
            <asp:MenuItem NavigateUrl="~/Login.aspx" Text ="Thoát" Value="SignOut"></asp:MenuItem>
        </Items>
    </asp:Menu>
        </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="SidebarPlaceHolder" Runat="Server">
    <asp:Menu ID="Menu2" runat="server" CssClass="Sidebar">
        <Items>
            <asp:MenuItem NavigateUrl="~/News.aspx" Text="Tin tức" Value="News"></asp:MenuItem>
            <asp:MenuItem NavigateUrl="~/QuanlySinhvien_Admin.aspx" Text="Quản lý tài khoản" Value="QuanlySinhvien"></asp:MenuItem>
        </Items>
    </asp:Menu>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainContentPlaceHolder" Runat="Server">
    <asp:Label ID="lblQuanLyUser" Text="Quản Lý User" runat="server" CssClass="LabelTitle"></asp:Label>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="SqlDataSource1" EmptyDataText="There are no data records to display.">
        <Columns>
            <asp:CommandField ShowSelectButton="True" />
            <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID" />
            <asp:BoundField DataField="Username" HeaderText="Username" SortExpression="Username" />
            <asp:BoundField DataField="Password" HeaderText="Password" SortExpression="Password" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="SoDT" HeaderText="SoDT" SortExpression="SoDT" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DanhGiaGiaoVienConnectionString1 %>" DeleteCommand="DELETE FROM [Admin] WHERE [ID] = @ID" InsertCommand="INSERT INTO [Admin] ([ID], [Username], [Password], [Email], [SoDT]) VALUES (@ID, @Username, @Password, @Email, @SoDT)" ProviderName="<%$ ConnectionStrings:DanhGiaGiaoVienConnectionString1.ProviderName %>" SelectCommand="SELECT [ID], [Username], [Password], [Email], [SoDT] FROM [Admin]" UpdateCommand="UPDATE [Admin] SET [Username] = @Username, [Password] = @Password, [Email] = @Email, [SoDT] = @SoDT WHERE [ID] = @ID">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="ID" Type="String" />
            <asp:Parameter Name="Username" Type="String" />
            <asp:Parameter Name="Password" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="SoDT" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Username" Type="String" />
            <asp:Parameter Name="Password" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="SoDT" Type="String" />
            <asp:Parameter Name="ID" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="ID" DataSourceID="SqlDataSource2" Height="50px" Width="125px">
        <Fields>
            <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID" />
            <asp:BoundField DataField="Username" HeaderText="Username" SortExpression="Username" />
            <asp:BoundField DataField="Password" HeaderText="Password" SortExpression="Password" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="SoDT" HeaderText="SoDT" SortExpression="SoDT" />
            <asp:CommandField ShowInsertButton="True" />
        </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:DanhGiaGiaoVienConnectionString1 %>" DeleteCommand="DELETE FROM Admin WHERE (ID = @ID)" InsertCommand="INSERT INTO Admin(ID, Username, Password, Email, SoDT) VALUES (@ID, @Username, @Password, @Email, @SoDT)" SelectCommand="SELECT * FROM [Admin] WHERE ([ID] = @ID)" UpdateCommand="UPDATE [Admin] SET [Username] = @Username, [Password] = @Password, [Email] = @Email, [SoDT] = @SoDT WHERE [ID] = @ID">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="ID" Type="String" />
            <asp:Parameter Name="Username" Type="String" />
            <asp:Parameter Name="Password" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="SoDT" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="GridView1" Name="ID" PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="Username" Type="String" />
            <asp:Parameter Name="Password" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="SoDT" Type="String" />
            <asp:Parameter Name="ID" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <br />
   
    
</asp:Content>

